/*    */ package com.newcrm.webapi.sub;
/*    */ 
/*    */ import com.newcrm.db.CustomerPermissionsChangeManager;
/*    */ import com.newcrm.exception.NotFoundException;
/*    */ import com.newcrm.util.Util;
/*    */ import com.newcrm.webapi.AbstractAction;
/*    */ import com.newcrm.webapi.AbstractHttpServlet;
/*    */ import java.io.IOException;
/*    */ import java.io.PrintWriter;
/*    */ import java.sql.SQLException;
/*    */ import java.util.List;
/*    */ import javax.servlet.ServletException;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ import javax.servlet.http.HttpServletResponse;
/*    */ import net.sf.json.JSONObject;
/*    */ 
/*    */ public class ListCustomerPermissionsChangeLog extends AbstractAction
/*    */ {
/*    */   public ListCustomerPermissionsChangeLog(AbstractHttpServlet servlet)
/*    */   {
/* 24 */     super(servlet);
/*    */   }
/*    */ 
/*    */   public void parse(HttpServletRequest request, HttpServletResponse response)
/*    */     throws IOException, ServletException, NotFoundException
/*    */   {
/* 30 */     response.setContentType("text/html;charset=utf-8");
/* 31 */     PrintWriter out = response.getWriter();
/* 32 */     JSONObject jsonObject = new JSONObject();
/* 33 */     int customerId = Util.getURLIntParameter(request
/* 34 */       .getParameter("customerId"));
/* 35 */     if (customerId <= 0) {
/* 36 */       jsonObject.put("error", "1");
/* 37 */       out.println(jsonObject);
/* 38 */       out.flush();
/* 39 */       out.close();
/* 40 */       return;
/*    */     }
/*    */ 
/* 43 */     CustomerPermissionsChangeManager manager = new CustomerPermissionsChangeManager();
/*    */     try
/*    */     {
/* 46 */       List items = manager.listChangeLog(customerId);
/* 47 */       jsonObject.put("items", items);
/* 48 */       jsonObject.put("error", "0");
/*    */     } catch (SQLException e) {
/* 50 */       jsonObject.put("error", "1");
/*    */     }
/* 52 */     out.println(jsonObject);
/* 53 */     out.flush();
/* 54 */     out.close();
/*    */   }
/*    */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.webapi.sub.ListCustomerPermissionsChangeLog
 * JD-Core Version:    0.6.1
 */